package com.example.zhinongbao.activity;


import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageButton;

import androidx.appcompat.app.AppCompatActivity;

import com.example.zhinongbao.R;

public class SettingActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting); // 需要创建对应的布局文件


        // 返回按钮
        findViewById(R.id.backButton).setOnClickListener(v -> finish());

        // 个人信息
        findViewById(R.id.personalInfoLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, PersonalInfoActivity.class));
        });


        // 地址管理
        findViewById(R.id.addressManagementLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, AddressManagementActivity.class));
        });

        // 隐私设置
        findViewById(R.id.privacySettingsLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, PrivacySettingsActivity.class));
        });

        // 登录密码
        findViewById(R.id.loginPasswordLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, LoginPasswordActivity.class));
        });

        // 提现密码
        findViewById(R.id.withdrawPasswordLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, WithdrawPasswordActivity.class));
        });

        // 联系客服
        findViewById(R.id.contactSupportLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, ContactSupportActivity.class));
        });

        // 意见反馈
        findViewById(R.id.feedbackLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, FeedbackActivity.class));
        });

        // 关于我们
        findViewById(R.id.aboutUsLayout).setOnClickListener(v -> {
            startActivity(new Intent(SettingActivity.this, AboutUsActivity.class));
        });

        // 隐私政策
        findViewById(R.id.privacyPolicyLayout).setOnClickListener(v -> {
            Intent intent = new Intent(SettingActivity.this, WebViewActivity.class);
            intent.putExtra("url", getString(R.string.privacy_policy_url));
            startActivity(intent);
        });

        // 用户协议
        findViewById(R.id.userAgreementLayout).setOnClickListener(v -> {
            Intent intent = new Intent(SettingActivity.this, WebViewActivity.class);
            intent.putExtra("url", getString(R.string.user_agreement_url));
            startActivity(intent);
        });
    }
}